class DoorFlagsController < ApplicationController
  # GET /door_flags
  # GET /door_flags.xml
  def index
    @door_flags = DoorFlag.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @door_flags }
    end
  end

  # GET /door_flags/1
  # GET /door_flags/1.xml
  def show
    @door_flag = DoorFlag.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @door_flag }
    end
  end

  # GET /door_flags/new
  # GET /door_flags/new.xml
  def new
    @door_flag = DoorFlag.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @door_flag }
    end
  end

  # GET /door_flags/1/edit
  def edit
    @door_flag = DoorFlag.find(params[:id])
  end

  # POST /door_flags
  # POST /door_flags.xml
  def create
    @door_flag = DoorFlag.new(params[:door_flag])

    respond_to do |format|
      if @door_flag.save
        format.html { redirect_to(@door_flag, :notice => 'Door flag was successfully created.') }
        format.xml  { render :xml => @door_flag, :status => :created, :location => @door_flag }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @door_flag.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /door_flags/1
  # PUT /door_flags/1.xml
  def update
    @door_flag = DoorFlag.find(params[:id])

    respond_to do |format|
      if @door_flag.update_attributes(params[:door_flag])
        format.html { redirect_to(@door_flag, :notice => 'Door flag was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @door_flag.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /door_flags/1
  # DELETE /door_flags/1.xml
  def destroy
    @door_flag = DoorFlag.find(params[:id])
    @door_flag.destroy

    respond_to do |format|
      format.html { redirect_to(door_flags_url) }
      format.xml  { head :ok }
    end
  end
end
